﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using OgilvyOne.BLL;
using System.Text;
using System.Xml;

public partial class allergy_lore_nestle_toal : System.Web.UI.Page
{
    private string total;
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt = BLLArticleInfo.flash();
        foreach (DataRow row in dt.Rows)
        {
            total = row["count"].ToString();
        }
        //生成xml文档
        Response.Clear();
        Encoding gb2312 = Encoding.GetEncoding("UTF-8");
        Response.ContentEncoding = gb2312;
        XmlDocument doc = new XmlDocument();
        XmlDeclaration decl = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
        doc.AppendChild(decl);

        //创建根节点   data
        XmlElement element = doc.CreateElement("result");
        doc.AppendChild(element);

        XmlElement data = doc.CreateElement("data");
        data.InnerText = total.ToString();
        element.AppendChild(data);

        //向页面输出xml文档
        Response.Write(doc.OuterXml);
        Response.End();

    }
}
